package com.foreknow.demo5Exercise3;


/**
 *每项订单类
 * 图书名称
 * 图书单价
 * 购买数量
 */
public class OrderItem {

    public OrderItem() {

    }

    private int no;
    private String name;
    private double price;
    private int howmany;

    public int getNo() {
        return no;
    }

    public void setNo(int no) {
        this.no = no;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public int getHowmany() {
        return howmany;
    }

    public void setHowmany(int howmany) {
        this.howmany = howmany;
    }

    public double money() {
        double money = 0;
        int no = getNo();
        int many = getHowmany();
        switch (no) {
            case 1:
                money = many*33.45;
                break;
            case 2:
                money = many*55.45;

                break;
            case 3:
                money = many*77.45;
                break;
        }
        return money;
    }

}
